package com.yuantu.judiciary.controller;

import com.yuantu.judiciary.common.Response;
import com.yuantu.judiciary.common.ResponseFactory;
import com.yuantu.judiciary.model.vo.AppVersionVO;
import com.yuantu.judiciary.service.IAppVersionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 移动端版本模块
 *
 * @author syw
 * @since 2023-06-24
 **/
@RestController
@RequestMapping(value = "/app-version")
@Api(tags = "移动端版本模块")
@RequiredArgsConstructor
public class AppVersionController {

    private final IAppVersionService appVersionService;

    @ApiOperation(value = "获取最新版本安装包链接")
    @GetMapping("/get/latest")
    public Response<AppVersionVO> getLatestDownloadLink() {
        return ResponseFactory.okResponse(appVersionService.getLatestDownloadLink());
    }

}
